Skip to content

Conversation

sfc-gh-pczajka
Copy link
Collaborator

Cherry-picks required to fix pipelines

@sfc-gh-pczajka sfc-gh-pczajka changed the base branch from main to dev/aio-connector August 13, 2025 11:26
@sfc-gh-pczajka sfc-gh-pczajka added NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md DO_NOT_PORT_CHANGES_TO_SP Add this label when changes in this PR do not need to be port to SP connector labels Aug 13, 2025
def test_ocsp_cache_when_server_is_down(
mock_fetch_ocsp_response, tmpdir, random_ocsp_response_validation_cache
):
def test_ocsp_cache_when_server_is_down(tmpdir):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not applied

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -303,7 +303,9 @@ class NotRetryableException(Exception):
def fake_request_exec(**kwargs):
headers = kwargs.get("headers")
cnt = headers["cnt"]
time.sleep(3)
time.sleep(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timeout changes from this file are not applied to async code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!; fixed

# Test that connection respects server default when not explicitly set
assert (
cnx.client_session_keep_alive == server_default
), f"Expected client_session_keep_alive={server_default} (server default), got {cnx.client_session_keep_alive}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can have those clear messages in async version as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

@sfc-gh-pczajka sfc-gh-pczajka force-pushed the aio-connector-fix-workflows branch from e673724 to 0dc54a6 Compare August 14, 2025 14:11
@sfc-gh-pczajka sfc-gh-pczajka force-pushed the aio-connector-fix-workflows branch from 149e337 to 322852d Compare August 14, 2025 15:18
assert ret == {"success": True, "data": "valid data"}
assert not rest._connection.errorhandler.called # no error

# first attempt to reach timeout even if the exception is retryable
cnt.reset()
ret = rest.fetch(timeout=1, **default_parameters)
ret = rest.fetch(
timeout=0.001, **default_parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not applied to the async code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

assert ret == {}
assert rest._connection.errorhandler.called # error

# not retryable excpetion
cnt.set(NOT_RETRYABLE)
with pytest.raises(NotRetryableException):
rest.fetch(timeout=7, **default_parameters)
rest.fetch(timeout=5, **default_parameters)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not applied

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

host=db_parameters["sf_host"],
port=db_parameters["sf_port"],
)
with conn_cnx("admin") as admin_cnxn:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be missed in async implementation

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

assert ret[1] == "true"

# Test client_session_keep_alive=False (connection parameter)
with conn_cnx(client_session_keep_alive=False) as connection:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was changed from ..alive=None to ..alive=False

and the expected behavior was changed, since in the last assert we expect now "false", not "true" as it is in asyncio

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch

@@ -69,21 +69,9 @@ def test_transaction(conn_cnx, db_parameters):
assert total == 13824, "total integer"


def test_connection_context_manager(request, db_parameters):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to be missed in the async implementation as well as the changes below in this file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, as well as unlocked the test - it was marked as "xfail" due to "await" inside

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO_NOT_PORT_CHANGES_TO_SP Add this label when changes in this PR do not need to be port to SP connector NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants